package com.sspku.weinotes.response;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class ServerResponse implements Serializable {
    //状态、消息、数据、数据集合
    private int status;
    private String msg;
    private Object data;
    private List<?> dataList;
    public ServerResponse() {
        this.status = 200;
        this.msg = "OK";
        this.data = "";
        this.dataList = new ArrayList<>();
    }

    public ServerResponse(int status, String msg) {
        this.status = status;
        this.msg = msg;
        this.data = "";
        this.dataList = new ArrayList<>();
    }

    public ServerResponse(Object data) {
        this.status = 200;
        this.msg = "OK";
        this.dataList = new ArrayList<>();
        this.data = data;
    }

    public ServerResponse(List<?> dataList) {
        this.status = 200;
        this.msg = "OK";
        this.data = "";
        this.dataList = dataList;
    }

    public ServerResponse(int status, String msg, Object data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
        this.dataList = new ArrayList<>();
    }

    public ServerResponse(int status, String msg, List<?> dataList) {
        this.status = status;
        this.msg = msg;
        this.data = "";
        this.dataList = dataList;
    }

    public ServerResponse(int status, String msg, List<?> dataList, Object data) {
        this.status = status;
        this.msg = msg;
        this.dataList = dataList;
        this.data = data;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public List<?> getDataList() {
        return dataList;
    }

    public void setDataList(List<?> dataList) {
        this.dataList = dataList;
    }
}
